<!--
 * @Description: 查看
 * @Author: Liu Zhiwang
 * @Date: 2021-06-08 16:18:15
 * @LastEditTime: 2021-06-08 19:29:46
 * @LastEditors: Liu Zhiwang
-->
<template>
  <div>
    <base-dialog
      class="dialog_box dialog-look"
      width="60%"
      :visible.sync="dialogLook.visible"
      :title="dialog.title"
      :loading="dialog.loading"
      :disabled="dialog.disabled"
      :show-default-footer="false"
      @updateData="updateData"
      @open="beforeOpenDialog">
      <el-form
        ref="dataForm"
        :model="dialog.form"
        :rules="dialog.rules"
        :disabled="dialog.disabled"
        label-width="100px">
        <table id="customers">
          <tr>
            <td>厂家名称</td>
            <td>{{ dialog.form.eqtName }}</td>
            <td>厂家编号</td>
            <td>{{ dialog.form.eqtNo }}</td>
          </tr>
          <tr>
            <td>联系人</td>
            <td>{{ dialog.form.contacts }}</td>
            <td>联系人电话</td>
            <td>{{ dialog.form.contactsPhone }}</td>
          </tr>
          <!-- <tr>
            <td>是否系统</td>
            <td>{{ dialog.form.isSystem?'是':'否' }}</td>
            <td>是否公用</td>
            <td>{{ dialog.form.isPub?'是':'否' }}</td>
          </tr>
          <tr>
            <td>状态</td>
            <td>{{ dialog.form.status?'启用':'禁用' }}</td>
            <td />
            <td />
          </tr>-->
          <tr>
            <td>备注</td>
            <td colspan="3">{{ dialog.form.remark }}</td>
          </tr>
        </table>
      </el-form>
    </base-dialog>
  </div>
</template>
<script>
export default {
  components: {},
  props: {
    dialog: {
      type: Object,
      default() {
        return {}
      }
    },
    dialogLook: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  data() {
    return {
    }
  },
  watch: {
    'dialogLook.visible'() {
      if (this.dialogLook.visible) {
        this.getList()
      }
    }
  },
  methods: {
    // 获取下拉数据、字典
    getList() {},

    // 回调方法
    updateData() {
      this.$refs.dataForm.validate((valid) => {
        if (valid) {
          this.dialog.loading = true
          this.$emit('updateData', this.dialog.form)
        }
      })
    },

    // 初始化
    beforeOpenDialog() {
      this.$nextTick(() => {
        this.$refs.dataForm.clearValidate()
      })
    }
  }
}
</script>
<style lang="scss">
.dialog-look {
  .el-dialog__body {
    height: calc(80vh - 1px);
    .base-table {
      height: 470px!important;
    }
  }
}
#customers {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 20px;
}
#customers td, #customers th {
  border: 1px solid #DFE6EC;
  font-size: 16px;
  line-height: 1.5;
  padding: 8px 0;
}
#customers tr td:nth-child(odd){
  width: 120px;
  white-space: nowrap;
  padding-left: 20px;
  padding-right: 26px;
  text-align: right;
  background: #E9F2FC;
}
#customers tr td:nth-child(even){
  padding-left: 20px;
  padding-right: 20px;
}
.dialog_box #customers tr td.file-box {
  width: 100%;
  text-align: left;
  background: #ffffff;
}
#customers .file-content {
  min-height: 187px;
}
</style>
